-- GENERATED SPELL FOR [Sunblade Dusk Priest] --


function spell0_25370(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(46561,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_25370', 7000, 1)
end

function spell1_25370(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(46562,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_25370', 4000, 1)
end

function spell2_25370(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(46560,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_25370', 15000, 1)
end

function Sorts_25370(pUnit, Event)
local choix_sorts_25370 = math.random(0, 2)
if choix_sorts_25370 == 0 then
pUnit:RegisterEvent('spell0_25370', 1, 1)
end
if choix_sorts_25370 == 1 then
pUnit:RegisterEvent('spell1_25370', 1, 1)
end
if choix_sorts_25370 == 2 then
pUnit:RegisterEvent('spell2_25370', 1, 1)
end
end

function mob25370_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_25370', math.random(1500, 3000), 1)
end

function mob25370_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob25370_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob25370_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(25370, 1, 'mob25370_Action')
RegisterUnitEvent(25370, 2, 'mob25370_Leave')
RegisterUnitEvent(25370, 3, 'mob25370_Kill')
RegisterUnitEvent(25370, 4, 'mob25370_Die')
